var app = new Vue({
    el: '#getNum',
    data: {
        num: ''
    },
    methods: {
        getNum: function () {
            let that = this;
            axios.get("/demo/num").then(
                function (res) {
                    let status = res.status;
                    if (status === 200) {
                        that.num = res.data;
                    } else {
                        console.log(res);
                    }
                }, function (err) {
                    console.log(err);
                }
            )
        },
        logout: function () {
            location.href = '../index.html';
        }
    },
    // 页面加载后自动调用方法
    mounted: function () {
        this.getNum();
        console.log(this.num);
    },
})